package com.time.sky.controller;


import com.time.sky.entity.Electric;
import com.time.sky.mapper.ElectricMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
public class ElectricController {
    @Autowired
    private ElectricMapper electricMapper;

    @RequestMapping("electric/selectElectricList")
    public List<Electric> selectElectricList(@RequestBody Electric electric){
        return electricMapper.selectElectric(electric);
    }

    @RequestMapping("electric/findAll")
    public List<Electric> findAll(){
        return electricMapper.selectElectric();
    }

}
